/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2024-03-08     Hao       the first version
 */
#ifndef HARDWARE_GPIO_OPERATE_H_
#define HARDWARE_GPIO_OPERATE_H_

#include <rtthread.h>
#include <rtdevice.h>

#ifdef __cplusplus
extern "C"{
#endif

typedef struct _gpio
{
    rt_base_t pin;
    rt_base_t mode;
}gpio_t;
typedef gpio_t *gpio_ptr;

extern gpio_t enable_pin;
extern gpio_t spi2_cs_pin;
extern gpio_t can_addr1_pin;
extern gpio_t can_addr2_pin;

void gpio_write(gpio_ptr port_ptr, rt_base_t value);
uint8_t gpio_read(gpio_ptr port_ptr);

#ifdef __cplusplus
}
#endif

#endif /* HARDWARE_GPIO_OPERATE_H_ */
